<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>过渡实验</title>
    <script src="../js/vue.js"></script>
    <style>
      /* .fade-enter-active,
      .fade-leave-active {
        transition: opacity 0.5s;
      } */

      .fade-leave-active {
        transition: opacity 2.5s;
      }

      .fade-enter-active {
        transition: opacity 0.5s;
      }

      .fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
        opacity: 0;
      }
    </style>
  </head>
  <body>
    <!-- div id="app" 挂载点 -->
    <div id="app">
      <button v-on:click="show = !show">Toggle</button>
      <transition name="fade">
        <p v-if="show">hello</p>
      </transition>
      <p>陈严标</p>
    </div>
    <!-- 使用javascript 脚本 -->
    <script type="text/javascript">
      new Vue({
        // 选择挂载元素的id
        el: "#app",
        data: {
          show: true,
        },
      });
    </script>
  </body>
</html>
